/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package ChateoController;

import java.io.File;

/**
 *
 * @author adrian
 */
public class FileTransfer {
    private int status;
    public static final int INITIATING=0;
    public static final int ACCEPTED=1;
    public static final int INPROGRESS=2;
    public static final int CANCELED=3;
    public static final int FINISHED=4;
    
    
    private String name;
    private int nbParts;
    private int remainingParts;
    private File file;
    private float size;
    private boolean incomming;
    
public FileTransfer(File file, boolean incomming){
    this.file=file;
    this.incomming=incomming;
    
}

public String incommingString(){
    if (this.incomming){
        return "<--";
    }
    else {
        return "-->";
    }
}

public boolean isIncomming(){
    return incomming;
}

public boolean isOutgoing(){
    if (incomming){
        return (false);
    }
    else{
    return (true);
    }
}



public String statusString(){
    if (this.status==FileTransfer.INITIATING){
        return "Initialisation";
    }
    if (this.status==FileTransfer.ACCEPTED){
        return "Accepted";
    }
    if (this.status==FileTransfer.INPROGRESS){
        return "In Progress ...";
    }
    if (this.status==FileTransfer.CANCELED){
        return "Canceled";
    }
    if (this.status==FileTransfer.FINISHED){
        return "Finished";
    }
    else {
        return "Error";
    }
}

public int setStatus(int status){
    this.status=status;
    return this.status;
}

}

